﻿using RapidRepository.TestMobileApplication.Entities;
using RapidRepository.Context;

namespace RapidRepository.TestMobileApplication.Repositories
{
    public class CustomerRepository : RapidRepository<Customer>
    {
        public override Customer Add(Customer entity)
        {
            var customer = base.Add(entity);
            RapidContext.CurrentContext.SaveChanges();
            return customer;
        }

        public override void Delete(System.Guid id)
        {
            base.Delete(id);
            RapidContext.CurrentContext.SaveChanges();
        }

        public override Customer Update(Customer entity)
        {
            var customer = base.Update(entity);
            RapidContext.CurrentContext.SaveChanges();
            return customer;
        }
    }
}
